package com.mm.ai.controller;


import com.mm.ai.service.DockerContainerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

import static com.mm.ai.utils.DockerUtil.CONTAINER_NAME;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tzy
 * @since 2024-10-15
 */
@Controller
@RequestMapping("/wechat")
public class UserInfoController {
    @Autowired
    private DockerContainerService dockerContainerService;

    @GetMapping("/")
    public String showEditor(Model model) {
        return "wechatLogin";
    }

    @GetMapping("/getQrUrls")
    @ResponseBody
    public List<String> getQrUrls() {
        return dockerContainerService.getItChatQRCodeUrlByContainer(CONTAINER_NAME);
    }
}

